import { _decorator, Component, Node } from 'cc';
import Singleton from '../Common/Singleton';
import { DataBaseMgr } from './DataBaseMgr';
const { ccclass, property } = _decorator;

@ccclass('DataMgr')
export class DataMgr extends Singleton<DataMgr>() {
    private _mapMgr:Map<string,DataBaseMgr> = new Map();

    addMgr(name:string,mgr:DataBaseMgr){
        if(!name||name.length <=0 ||!mgr){
            return;
        }
        this._mapMgr.set(name,mgr);
    }

    getMgr<T extends DataBaseMgr>(name:string):T{
        if(!name||name.length <=0){
            return null;
        }
        return <T>(this._mapMgr.get(name));
    }
}




